package com.yc.bank.biz;

import com.yc.bank.entity.Oprecord;
import com.yc.bank.mapper.AccountMapper;
import com.yc.bank.mapper.OprecordMapper;
import com.yc.bank.util.MyBatisHelper;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service
@Transactional
public class OprecordBiz {

    public List<Oprecord> query(String id) {
        SqlSession session = MyBatisHelper.getSession();
        try {
            OprecordMapper oprecordMapper = session.getMapper(OprecordMapper.class);
            List<Oprecord> list = oprecordMapper.selectByAid(id);
            return list;
        } catch (RuntimeException e) {
            e.printStackTrace();
        }finally {
            session.close();
        }
        return null;
    }
}
